<?php

namespace App\Http\Controllers\Code;
use Session;
use Illuminate\Http\Request;
use App\Http\Service\User\UserService;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class CodeController extends Controller
{
    public function getCode(Request $request)
    {
        $code = $request->input('validateCode');
        $validateCode = Session::get('validateCode');
        $data = [];
        $where=[];
        $where['mobile']=$request->input('mobile');

        if($code != $validateCode)
        {
            $data=array(
                'error_code'=>1,
                'error_message'=>'验证码输入错误',
            );
            return $data;
        }
        $user = new UserService();
        $data = $user->getCode($where);

        return $data;



    }
}
